<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>sessionStroage.html</title>
</head>
<body>
<script type="text/javascript">
    if (sessionStorage.pagecount)
    {
        sessionStorage.pagecount=Number(sessionStorage.pagecount) +1;
    }
    else
    {
        sessionStorage.pagecount=1;
    }
    if (sessionStorage.pagecount==1){
        window.location.href="../index.html";
    }
    document.write("Visits " + sessionStorage.pagecount + " time(s) this session.");
</script>
<p>刷新页面会看到计数器在增长。</p>
<p>请关闭浏览器窗口，然后再试一次，计数器已经重置了。</p>
</body>
</html>
